const router = require("koa-router")();
const ShoesModel = require("../../models/shoesList");
const {mongoList} = require("../../static/data");
router.get("/api/detail",async ctx=>{
    let {id} = ctx.query;
    var res=""
    for(let m of mongoList){
        res = await ShoesModel(m).find({_id:id});
        // 搜到了就跳出循环
        if(res.length != 0){
            break;
        }
    }
    ctx.body = {
        code:200,
        res,
        msg:`请求成功!共有数据${res.length}条。`
    }
})
module.exports = router;